package com.suxin.netty;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.junit.Test;

/**
 * @author Tang
 * @classname TestMain
 * @description [  ]
 * @date 2021/7/18 21:17
 */
public class TestMain {

    public static void main(String[] args) {

        ByteBuf byteBuf = Unpooled.directBuffer();

        byteBuf.writeInt(4);
        byteBuf.writeBytes("hello world!".getBytes());

        System.out.println(byteBuf.readInt());
        System.out.println(byteBuf.readableBytes());
    }

    @Test
    public void test01(){
        System.out.println("xxxx".getBytes().length);
    }

}